﻿
'*******************************************************************
' Program: Data Center Visio Rack Tool
' Author: Albert E Edlund
' Date:
'
' Purpose:
'
'
'
'*******************************************************************


Imports Microsoft.Practices.EnterpriseLibrary.Common
Imports Microsoft.Practices.EnterpriseLibrary.Data
Imports Microsoft.Practices.EnterpriseLibrary.ExceptionHandling
Imports Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging


Imports System
Imports System.ComponentModel
Imports System.Collections.Generic


Public Class dc_Location
    Implements INotifyPropertyChanged

#Region "Events"

    Public Event PropertyChanged(ByVal sender As Object, ByVal e As System.ComponentModel.PropertyChangedEventArgs) Implements System.ComponentModel.INotifyPropertyChanged.PropertyChanged

    Private Sub OnPropertyChanged(ByVal info As String)
        RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(info))
    End Sub

#End Region

#Region " Properties and Fields "

    Private m_locKey As Int32
    Private m_locClientKey As Int32
    Private m_locClientName As String
    Private m_locSiteId As String
    Private m_locCompanyName As String
    Private m_locAddress1 As String
    Private m_locAddress2 As String
    Private m_locCity As String
    Private m_locState As String
    Private m_locZip As Int32
    Private m_locZipP4 As Int32
    Private m_locCountry As String
    Private m_locContact As String
    Private m_locBackupContact As String
    Private m_locPhone As String
    Private m_locFax As String
    Private m_locSubnet As String
    Private m_locMask As String
    Private m_locComments As String
    Private m_locLastUpdate As DateTime
    Private m_locLastEdit As String

    Private Const constLocKey As Int32 = -1
    Private Const constLocClientKey As Int32 = -1
    Private Const constLocClientName As String = "na"
    Private Const constLocSiteId As String = "Location"
    Private Const constLocCompanyName As String = "na"
    Private Const constLocAddress1 As String = "na"
    Private Const constLocAddress2 As String = "na"
    Private Const constLocCity As String = "na"
    Private Const constLocState As String = "na"
    Private Const constLocZip As Int32 = 99999
    Private Const constLocZipP4 As Int32 = 9999
    Private Const constLocCountry As String = "USA"
    Private Const constLocContact As String = "na"
    Private Const constLocBackupContact As String = "na"
    Private Const constLocPhone As String = "1-312-555-1212"
    Private Const constLocFax As String = "1-312-555-1212"
    Private Const constLocSubnet As String = "127.0.0.0"
    Private Const constLocMask As String = "255.255.255.0"
    Private Const constLocComments As String = "na"
    Private Const constLocLastUpdate As DateTime = #1/1/2001#
    Private Const constLocLastEdit As String = "na"

    Property locKey() As Int32
        Get
            Return Me.m_locKey
        End Get
        Set(ByVal value As Int32)
            Me.m_locKey = value
            Me.OnPropertyChanged("locKey")
        End Set
    End Property


    Property locClientKey() As Int32
        Get
            Return Me.m_locClientKey
        End Get
        Set(ByVal value As Int32)
            Me.m_locClientKey = value
            Me.OnPropertyChanged("locClientKey")
        End Set
    End Property

    Property locClientName() As String
        Get
            Return Me.m_locClientName
        End Get
        Set(ByVal value As String)
            Me.m_locClientName = value
            Me.OnPropertyChanged("locClientName")
        End Set
    End Property

    Property locSiteId() As String
        Get
            Return Me.m_locSiteId
        End Get
        Set(ByVal value As String)
            Me.m_locSiteId = value
            Me.OnPropertyChanged("locSiteId")
        End Set
    End Property

    Property locCompanyName() As String
        Get
            Return Me.m_locCompanyName
        End Get
        Set(ByVal value As String)
            Me.m_locCompanyName = value
            Me.OnPropertyChanged("locCompanyName")
        End Set
    End Property

    Property locAddress1() As String
        Get
            Return Me.m_locAddress1
        End Get
        Set(ByVal value As String)
            Me.m_locAddress1 = value
            Me.OnPropertyChanged("locAddress1")
        End Set
    End Property

    Property locAddress2() As String
        Get
            Return Me.m_locAddress2
        End Get
        Set(ByVal value As String)
            Me.m_locAddress2 = value
            Me.OnPropertyChanged("locAddress2")
        End Set
    End Property

    Property locCity() As String
        Get
            Return Me.m_locCity
        End Get
        Set(ByVal value As String)
            Me.m_locCity = value
            Me.OnPropertyChanged("locCity")
        End Set
    End Property

    Property locState() As String
        Get
            Return Me.m_locState
        End Get
        Set(ByVal value As String)
            Me.m_locState = value
            Me.OnPropertyChanged("locState")
        End Set
    End Property

    Property locZip() As Int32
        Get
            Return Me.m_locZip
        End Get
        Set(ByVal value As Int32)
            Me.m_locZip = value
            Me.OnPropertyChanged("locZip")
        End Set
    End Property

    Property locZipP4() As Int32
        Get
            Return Me.m_locZipP4
        End Get
        Set(ByVal value As Int32)
            Me.m_locZipP4 = value
            Me.OnPropertyChanged("locZipP4")
        End Set
    End Property

    Property locCountry() As String
        Get
            Return Me.m_locCountry
        End Get
        Set(ByVal value As String)
            Me.m_locCountry = value
            Me.OnPropertyChanged("locCountry")
        End Set
    End Property

    Property locContact() As String
        Get
            Return Me.m_locContact
        End Get
        Set(ByVal value As String)
            Me.m_locContact = value
            Me.OnPropertyChanged("locContact")
        End Set
    End Property

    Property locBackupContact() As String
        Get
            Return Me.m_locBackupContact
        End Get
        Set(ByVal value As String)
            Me.m_locBackupContact = value
            Me.OnPropertyChanged("locBackupContact")
        End Set
    End Property

    Property locPhone() As String
        Get
            Return Me.m_locPhone
        End Get
        Set(ByVal value As String)
            Me.m_locPhone = value
            Me.OnPropertyChanged("locPhone")
        End Set
    End Property

    Property locFax() As String
        Get
            Return Me.m_locFax
        End Get
        Set(ByVal value As String)
            Me.m_locFax = value
            Me.OnPropertyChanged("locFax")
        End Set
    End Property


    Property locSubnet() As String
        Get
            Return Me.m_locSubnet
        End Get
        Set(ByVal value As String)
            Me.m_locSubnet = value
            Me.OnPropertyChanged("locSubnet")
        End Set
    End Property

    Property locMask() As String
        Get
            Return Me.m_locMask
        End Get
        Set(ByVal value As String)
            Me.m_locMask = value
            Me.OnPropertyChanged("locMask")
        End Set
    End Property

    Property locComments() As String
        Get
            Return Me.m_locComments
        End Get
        Set(ByVal value As String)
            Me.m_locComments = value
            Me.OnPropertyChanged("locComments")
        End Set
    End Property

    Property locLastUpdate() As DateTime
        Get
            Return Me.m_locLastUpdate
        End Get
        Set(ByVal value As DateTime)
            Me.m_locLastUpdate = value
            Me.OnPropertyChanged("locLastUpdate")
        End Set
    End Property

    Property locLastEdit() As String
        Get
            Return Me.m_locLastEdit
        End Get
        Set(ByVal value As String)
            Me.m_locLastEdit = value
            Me.OnPropertyChanged("locLastEdit")
        End Set
    End Property



#End Region

#Region " Constructor "

    Public Sub New()
        initProperties()
    End Sub

    Public Sub New(ByVal strUserId As String)
        initProperties()
        Me.m_locLastEdit = strUserId
    End Sub

#End Region

#Region " Methods "

    Public Sub initProperties()

        Try

            locKey = constLocKey
            locClientKey = constLocClientKey
            locClientName = constLocClientName
            locCompanyName = constLocCompanyName
            locAddress1 = constLocAddress1
            locAddress2 = constLocAddress2
            locCity = constLocCity
            locState = constLocState
            locZip = constLocZip
            locZipP4 = constLocZipP4
            locCountry = constLocCountry
            locContact = constLocContact
            locBackupContact = constLocBackupContact
            locPhone = constLocPhone
            locFax = constLocFax
            locSubnet = constLocSubnet
            locMask = constLocMask
            locComments = constLocComments
            locLastUpdate = Now
            locLastEdit = constLocLastEdit


        Catch ex As Exception
            Dim rethrow As Boolean = ExceptionPolicy.HandleException(ex, "Log Only Policy")
            If (rethrow) Then
                Throw
            End If
        End Try

    End Sub


#End Region


End Class



